package src;

public class Main48 {
    public class ExceptionDemo {
        public static void main(String[] args) {
            Main48 d = new Main48(); // 修正类名
            try {
                int x = d.div(5, 1); // 确保a>4
                System.out.println("x=" + x);
            } catch (ArithmeticException | ArrayIndexOutOfBoundsException e) {
                System.out.println(e.toString());
            }
            System.out.println("Over");
        }
    }
    public int div(int a, int b) {
        if (a > 4) {
            return a / b;
        }
        throw new ArrayIndexOutOfBoundsException("a<=4");
    }
}
